import {Vue} from 'vue-property-decorator';
import Config from './config';

export default class AppBase extends Vue {
    hasPermission(perminssionName: string) {
        return window.abp.auth.hasPermission(perminssionName);
    }

    hasAnyOfPerminssions(...args: string[]) {
        return window.abp.auth.hasAnyOfPerminssions(...args);
    }

    hasAllOfPerminssions(...args: string[]) {
        return window.abp.auth.hasAllOfPerminssions(...args);
    }

    L(value: string, source?: string, ...argus: string[]): string {
        if (source) {
            return window.abp.localization.localize(value, source, argus);
        } else {
            return window.abp.localization.localize(value, Config.localization.defaultLocalizationSourceName, argus);
        }

    }
};
